package com.niuniu.rushdorm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.niuniu.rushdorm.pojo.response.RoomInfo;
import com.niuniu.rushdorm.pojo.entity.Room;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
 * @author rambo
 * 2022/11/25
 */
@Mapper
public interface RoomMapper extends BaseMapper<Room> {
    @Select("select building_id,name,gender,`describe`,image_url from rooms where id = #{id} and is_del = 0")
    @Results(id = "getRoomById",value={
            @Result(property = "building_id",column = "building_id"),
            @Result(property = "image_url",column = "image_url"),
    })
    RoomInfo GetRoomById(long id);
}
